window.onload=function(){
    var arr = document.getElementsByTagName("li");
    console.log(arr.length);
    for(let i=0; i<arr.length; i++){
        arr[i].onclick=function(){
            console.log(i);
            //创建新图片
            var pic = document.createElement("img");//<img/>
            pic.src="images/"+(i+1)+".jpg";
            pic.style.height="100%";
            pic.style.width="100%";

            document.getElementById("zhezhao").style.display="block";
            document.getElementById("closeFlag").style.display="block";
            document.getElementById("bigpic").style.display="block";
            document.getElementById("bigpic").innerHTML="";
            document.getElementById("bigpic").appendChild(pic);
            
        }
    }

    document.getElementById("closeFlag").onclick=function(){
        document.getElementById("zhezhao").style.display="none";
        document.getElementById("closeFlag").style.display="none";
        document.getElementById("bigpic").style.display="none";
    }
}

